<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/index/css/style.css"/>
    <link rel="stylesheet" type="text/css" href="__STATIC__/index/css/swiper.min.css"/>
    <script type="text/javascript" src="__STATIC__/index/js/rem.js"></script>
    <title>搜索结果</title>
</head>
<body>
<div class="hot_detail">
    <!--搜索框-->
    <div class="search_ipt">
        <label>
            <input id="search" type="search" name="" value="{$key}" placeholder="请输入搜索内容" onkeydown="enterSearch(event)"/>
            <img id="gosearch" src="__STATIC__/index/img/icon-search.png" style="width: 0.3rem;height: 0.3rem;position: absolute;top: 25%;right: 0.3rem" alt="">
        </label>
    </div>
    <!--主体-->
    <div class="recommend_list">
        <ul class="list clear">
            {foreach $goods as $g}
            <a href="/index/shop/detail?id={$g.id}">
                <li>
                    <!--图片-->
                    <div class="recommend_img">
                        <img class="auto-img" lay-src="{$g.goods_logo}"/>
                    </div>
                    <!--描述-->
                    <div class="des text-center">
                        <p class="bigger-text smoth">{$g.goods_title}</p>
                        <p class="recommend_money">
                            <span class="super-text brown in-lineblock">￥{$g.price_one}</span>
                            <s class="in-lineblock">￥{$g.price_two}</s>
                        </p>
                    </div>
                </li>
            </a>
            {/foreach}
        </ul>
    </div>
</div>
<script type="text/javascript" src="__STATIC__/index/js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="__STATIC__/plugs/layui/layui.all.js"></script>
<script type="text/javascript">
    function enterSearch(event) {
        $('#search').bind('search', function () {
            var value = $('#search').val();
            if (event.keyCode == 13) {
                window.location.replace('/index/shop/search?key=' + value);
            }
        })
    }

    $('#gosearch').click(function () {
        var value = $('#search').val();
        window.location.replace('/index/shop/search?key=' + value);
    })

    layui.use('flow', function(){
        var flow = layui.flow;
        //当你执行这样一个方法时，即对页面中的全部带有lay-src的img元素开启了懒加载（当然你也可以指定相关img）
        flow.lazyimg();
    });
</script>
</body>
</html>